package com.sky.controller.user;

import com.sky.pojo.Dish;
import com.sky.result.Result;
import com.sky.service.user.UserDishService;
import com.sky.vo.DishVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apiguardian.api.API;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/dish")
@Api(tags = "c端-菜品相关接口")
@RequiredArgsConstructor
@Slf4j
public class UserDishController {
    private final UserDishService userDishService;

    @GetMapping("/list")
    @ApiOperation("根据分类id查询菜品")
    public Result<List<DishVO>> findListByCategory(Long categoryId){
        List<DishVO> list = userDishService.findListByCategory(categoryId);
        return Result.success(list);
    }
}
